package com.example.apitest.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.example.apitest.R;
import com.example.apitest.bean.MenuBean;
import com.example.common.utils.DisplayUtils;
import com.example.common.utils.ImgLoader;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

public class MainAdapter extends BaseQuickAdapter<MenuBean, BaseViewHolder> {

    public MainAdapter(@Nullable List<MenuBean> data) {
        super(R.layout.item_main_menu, data);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, MenuBean menuBean) {
        baseViewHolder.setText(R.id.tv_menuName, menuBean.getName());
        ImgLoader.loadRoundImg(getContext(), menuBean.getIconId(), baseViewHolder.getView(R.id.iv_icon));
    }
}
